<include file="public@header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:url('grade/index')}">成绩列表</a></li>
			<li class="active"><a href="{:url('grade/add')}">添加成绩</a></li>
		</ul>
		<form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('grade/addpost')}">

			<div class="form-group">
				<label  class="col-sm-2 control-label"><span class="form-required">*</span>选择学生</label>
				<div class="col-md-6 col-sm-10">
					<select name='student_id' class="form-control" >
						<option value="">请选择学生</option>
						<foreach name="student" item="vo">
							<option value="{$vo.id}">{$vo.student_name}</option>
						</foreach>
					</select>
				</div>
			</div>

			<div class="form-group">
				<label  class="col-sm-2 control-label"><span class="form-required">*</span>选择科目</label>
				<div class="col-md-6 col-sm-10">
					<select name='subject_id' class="form-control" >
						<option value="">请选择科目</option>
						<foreach name="subject" item="vo">
							<option value="{$vo.id}">{$vo.subject}</option>
						</foreach>
					</select>
				</div>
			</div>



			<div class="form-group">
				<label for="grade" class="col-sm-2 control-label"><span class="form-required">*</span>成绩</label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" id="grade" name="grade">
				</div>
			</div>


			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
				</div>
			</div>
		</form>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
	<script>
		$(function () {

			$('#selectSchool').change('click',function () {

				var schoolId=$('#selectSchool').val();

				$.ajax({
					url:"{:url('student/getSchool')}",
					type:"POST",
					data:{school_id:schoolId},
					success:function (res) {
						console.log(res);
						$('#selectRoom').html(res);
					}
				});
			});
		})
	</script>

</body>
</html>